package org.samcolon.eeexplore.service.impl;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Console;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.samcolon.eeexplore.entity.SysMenu;
import org.samcolon.eeexplore.service.SysMenuService;
import org.samcolon.eeexplore.mapper.SysMenuMapper;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 *
 */
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu>
    implements SysMenuService{

    @Override
    public void batchInsert() {
        List<SysMenu> testData = getTestData();
        this.saveBatch(testData);
        testData.forEach(Console::log);
    }

    private static List<SysMenu> getTestData(){
        List<SysMenu> list = CollUtil.newArrayList();
        for (int i = 0; i < 20; i++) {
            list.add(new SysMenu(i, i, "name" + i, "permission" + i, "path" + i, i, "icon" + i, i, i, i, new Date(), new Date(), i, i, i, i, String.valueOf(i),i,"config" + i, "viewPath" + i, "title" + i, "redirect" + i, i, i));
        }
        return list;
    }
}




